﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace TMIS
{
    public partial class frmMain : XtraForm
    {
        public Guid guid = Guid.Empty;
        public string identity = String.Empty;
        public frmMain()
        {
            InitializeComponent();
        }

        public frmMain(Guid guid, string identity)
        {
            InitializeComponent();
            if (identity == "学生")
            {
                this.btnAgency.Visible = false;
                this.btnStatisticsMS.Visible = false;
                this.btnRecommendMS.Visible = false;
                this.btnRecommendMS.Visible = false;
                this.btnSummaryMS.Visible = false;
                this.guid = guid;
            }
            else 
            {
                this.btnApprovalMS.Visible = false;
                this.btnOpenReportMS.Visible = false;
                this.btnOpinionMS.Visible = false;
                this.btnIdentifyMS.Visible = false;
                this.btnReplyMS.Visible = false;
                this.btnRecommendMS.Visible = false;

            }
        }

        private void frmMain_FormClosed(object sender, FormClosedEventArgs e)
        {
            Application.Exit();
        }

        private void MainMenu_ItemAdded(object sender, ToolStripItemEventArgs e)
        {
            e.Item.Visible = false;
        }

        private void btnApproval_Click(object sender, EventArgs e)
        {
            foreach (var f in this.MdiChildren)
            {
                f.Close();
            }
            frmApproval frm = new frmApproval(this.guid);
            frm.Show();
        }

        private void btnOpenReport_Click(object sender, EventArgs e)
        {
            foreach (var f in this.MdiChildren)
            {
                f.Close();
            }
            frmOpenReport frm = new frmOpenReport(this.guid);
            frm.Show();
        }

        private void btnAgencyMS_Click(object sender, EventArgs e)
        {
            foreach (var f in this.MdiChildren)
            {
                f.Close();
            }
            frmAgency frm = new frmAgency();
            frm.Show();
                

        }

        private void btnTeacherMS_Click(object sender, EventArgs e)
        {
            foreach (var f in this.MdiChildren)
            {
                f.Close();
            }
            frmTeacher frm = new frmTeacher();
            frm.TeacherView.Enabled = true;
            frm.Show();
        }

        private void btnInstructionOpinion_Click(object sender, EventArgs e)
        {
            foreach (var f in this.MdiChildren)
            {
                f.Close();
            }
            frmInstructionOpinion frm = new frmInstructionOpinion(this.guid);
            frm.Show();
        }

        private void btnReviewOpinion_Click(object sender, EventArgs e)
        {
            foreach (var f in this.MdiChildren)
            {
                f.Close();
            }
            frmReviewOpinion frm = new frmReviewOpinion(this.guid);
            frm.Show();
        }

        private void btnTopicStatistics_Click(object sender, EventArgs e)
        {
            foreach (var f in this.MdiChildren)
            {
                f.Close();
            }
            frmTopicsStatistics frm = new frmTopicsStatistics();
            frm.Show();
        }

        private void btnThesisMS_Click(object sender, EventArgs e)
        {
            foreach (var f in this.MdiChildren)
            {
                f.Close();
            }
            frmThesis frm = new frmThesis();
            frm.Show();
        }

        private void btnIdentify_Click(object sender, EventArgs e)
        {
            foreach (var f in this.MdiChildren)
            {
                f.Close();
            }
            frmIdentify frm = new frmIdentify(this.guid);
            frm.Show();
        }

        private void btnReplyMS_Click(object sender, EventArgs e)
        {
            foreach (var f in this.MdiChildren)
            {
                f.Close();
            }
            frmReply frm = new frmReply(this.guid);
            frm.Show();
        }

        private void btnSummaryMS_Click(object sender, EventArgs e)
        {
            foreach (var f in this.MdiChildren)
            {
                f.Close();
            }
            frmSummary frm = new frmSummary();
            frm.Show();
        }

        private void btnRecommendMS_Click(object sender, EventArgs e)
        {
            foreach (var f in this.MdiChildren)
            {
                f.Close();
            }
            frmRecommend frm = new frmRecommend(guid);
            frm.Show();
        }

        private void btnStudentMS_Click(object sender, EventArgs e)
        {
            foreach (var f in this.MdiChildren)
            {
                f.Close();
            }
            frmStudent frm = new frmStudent();
            frm.Show();
        }

        private void btnScoreStatistics_Click(object sender, EventArgs e)
        {

        }


    }
}
